Skip to content

o2-sim: VecGeom parallel world for a misaligned ITS - #16134

Draft
sawenzel wants to merge 3 commits into
AliceO2Group:devfrom
sawenzel:swenzel/o2sim-vecgeom-parallelworld
Draft

sawenzel wants to merge 3 commits into
AliceO2Group:devfrom
sawenzel:swenzel/o2sim-vecgeom-parallelworld

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

VecGeom parallel world for simulation with a misaligned ITS

This PR introduces a parallel world for G4.navmode=kVecGeom, the VecGeom counterpart of the TGeoParallelWorld that gives the aligned ITS chips, sensors and metal stacks priority over the main hierarchy. This is an important step towards using VecGeom navigation in simulations with a misaligned geometry.

It is enabled with the existing switch GeometryManagerParam.useParallelWorld=true, as for TGeo, and follows the same rules: the node added first holds the point, and a track inside a node sees no other node. The nodes are searched with a VecGeom IndexedBVH. It is available for the default kRelocating navigator; kPropagated refuses the parallel world.

The validation uses ITS + PIPE with the ITS alignment from CCDB. A unit test compares locate and ray entry with TGeoParallelWorld on a toy geometry with misaligned, overlapping chips. In Pythia8 pp events the parallel world recovers the ITS hits lost with alignment, for both navigators:

ITS hits relative to the ideal geometry TGeo VecGeom
aligned, no parallel world 0.72 0.70
aligned, parallel world 0.99 0.99

With the parallel world, VecGeom gives 0.999 ± 0.005 of the TGeo hit count in 1500 events, and for 5000 muons 99.6 % of the (muon, chip) pairs are the same.

Note that nothing changes when the parallel world is not requested: the hit counts per event and detector are identical to before. When it is used, it costs about 3–4 % of CPU time in an ITS + PIPE simulation, against about 5 % for TGeo.

In summary: G4.navmode=kVecGeom can now be run with ITS alignment and the parallel world, with ITS hits in agreement with TGeo navigation.

This PR sits on top of #16133; only the last commit is new.

Assisted by Claude Code.

@sawenzel
sawenzel force-pushed the swenzel/o2sim-vecgeom-parallelworld branch 2 times, most recently from 1822820 to d50502e Compare November 17, 2026 11:48
sawenzel and others added 3 commits November 18, 2026 09:52
…vigator

This fixes a problem in the VecGeom navigator and adds a unit test.

- The locate after a crossing used the direction after the step, which multiple scattering can turn back into the volume just left.
- The track was then put into the mother of two touching layers with a zero-length step, where electrons below the cut of the air were killed.
- The crossing is now located along the direction of the step that found it, as the Geant4 navigator does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This fixes event aborts of the VecGeom navigator for tracks tangent to a face between a volume with a magnetic field and one without, and adds a unit test.

- The field propagator crosses such a face along its chord and the following straight step leaves it again, so the track alternates between the two volumes with zero-length steps.
- The stuck-track push was also added to the chord step, which the propagator takes for a miss, so the crossing never happened and the event was aborted after 25 zero steps.
- Now only steps along the momentum are lengthened once both kinds have occurred.
- The push is capped at 10 um, below the thinnest layers of the detectors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit lets G4.navmode=kVecGeom run with GeometryManagerParam.useParallelWorld and adds a unit test.

- VecGeomParallelWorld holds the prioritised placements of the TGeo parallel world with a VecGeom IndexedBVH over their boxes.
- The relocating navigator gives a node that holds the point priority in every locate, and limits step and safety by the nodes while the track is outside them.
- The rules are those of TGeoParallelWorld: the node added first wins, and inside a node the others are not seen.
- The propagating navigator still refuses the parallel world.
- The walk from a Geant4 path to a VecGeom state moves into VecGeomG4Map, where the parallel world reuses it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant